package seqlist.link.leetcode;

/**
 * @author yuisama
 * @date 2023/03/19 10:09
 * 链表的中间位置
 **/
public class Num876_MiddleOfList {
    public ListNode middleNode(ListNode head) {
        // 快慢指针法
        ListNode low = head,fast = head;
        while (fast != null && fast.next != null) {
            low = low.next;
            fast = fast.next.next;
        }
        return low;
    }
}